import java.util.Arrays;
import java.util.Scanner;

import static java.lang.Math.pow;


public class Test {
    public static void printArray(int[] array,int len) {
        //递归实现数组的逆序打印
        System.out.print(array[len-1]+" ");
        if(len!=1) {
            printArray(array,len-1);
        }
    }

    public static void main(String[] args) {
        //字符串排序
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()) {
            String str=scanner.nextLine();
            char[]array=new char[27];
            for (int i = 0; i < str.length(); i++) {
                array[str.charAt(i)-'a']++;
            }
            for (int i = 0; i < array.length; i++) {
                while (array[i]!=0) {
                    System.out.print((char)(i+'a')+" ");
                    array[i]--;
                }
            }
        }
    }
    public static void main23(String[] args) {
        int[]array={1,2,3,4,5,6,7,8,9};
        printArray(array,array.length);
    }
    public static int reverse (int x) {
        // write code here
        //判断正负号
        int flog=1;//1为正
        if(x<0) {
            x*=-1;
            flog=-1;//为负
        }
        int x1=x;
        int count=0;
        while(x1!=0) {
            x1/=10;
            count++;
        }
        x1=x;
        int sum=0;
        while(count!=0) {
            //12
            if(pow(10,count-1)>pow(2,31)) {
                return 0;
            }
            sum+=x1%10*pow(10,count-1);
            x1/=10;
            count--;
        }
        return flog*sum;

    }

    public static void main22(String[] args) {
        System.out.println(reverse(-123));
    }
    public static int FirstNotRepeatingChar(String str) {
        int[]array=new int[28];
        for(int i=0;i<str.length();i++) {
            array[str.charAt(i)-'a']++;
        }
        //遍历第二次
        for(int i=0;i<str.length();i++) {
            if(array[(str.charAt(i)-'a')]==1) {
                return i;
            }
        }
        return -1;
    }

    public static void main17(String[] args) {
        System.out.println(FirstNotRepeatingChar("hhello"));
    }
    public static String reverseOnlyLetters(String s) {
        int left=0;
        int right=s.length()-1;
        char[]array=s.toCharArray();
        while(left<right) {
            while((!(array[left]>='a'&&array[left]<='z'))&&(!(array[left]>='A'&&array[left]<='Z'))) {
                left++;
            }
            while((!(array[right]>='a'&&array[right]<='z'))&&(!(array[right]>='A'&&array[right]<='Z'))) {
                right--;
            }
            char c='a';
            System.out.println((int)c);
            char tmp=array[left];
            array[left]=array[right];
            array[right]=tmp;
            left++;
            right--;
        }

        return new String(array);
    }

    public static void main15(String[] args) {
        System.out.println(reverseOnlyLetters("a-bC-dEf-ghIj"));
    }
    public static void main13(String[] args) {

        int arr[]={1,2,3,45,6};
        System.out.println();
        String s = "hello";
        String t = "hello";
        char c[] = {'h', 'e', 'l', 'l', 'o'};
        System.out.println(s.equals(t));
        System.out.println(t.equals(new String("hello")));
        System.out.println(s.equals(c));
        System.out.println(s==t);
    }
    static boolean foo(char c) {
        System.out.print(c);
        return true;
    }
    public static int lengthOfLastWord(String s) {

        int right=s.length()-1;
        int count=0;
        int sum=0;
        for (int i = right; i >=0 ; i--) {
            if(s.charAt(i)!=' ') {
               count=i;//记录最后的不是空格的位置
                break;
            }
        }
        for (int i = count; i >=0 ; i--) {
            if(s.charAt(i)==' ') {
                sum=i+1;//+1是字母的首位
                break;
            }
        }
        //+1是最后字母的下一个位置
        return count+1-sum;

    }
    public static int lengthOfLastWord1(String s) {
//        //返回最后一个单词的长度
//        String p2=s.trim();
//        int p=p2.lastIndexOf(" ");
//        String p1=p2.substring(p+1,p2.length());
//        System.out.println(p1.length());
        return s.trim().substring(s.trim().lastIndexOf(" ")+1,s.trim().length()).length();
    }

    public static void main11(String[] args) {
        System.out.println(lengthOfLastWord("   fly me   to   the moon  "));
        System.out.println(lengthOfLastWord("                           "));
    }
    public static void main10( String[] argv ) {
        int i = 0;
        for ( foo('A'); foo('B') && (i < 2); foo('C')) {
            i++ ;
            foo('D');
        }
        System.out.println();
    }
    public static void main9(String[] args) {
        float[][]f=new float[6][6];
        float[][]f1=new float[6][];
       // float[][]f2=new float[][6];
        float f3 [][]=new float[6][6];
        int x=20,y=5;
        int p1=3/(int)pow(2,10);
        System.out.println(x+y +""+(x+y)+y);

    }
    public static void main8(String[] args) {
        //例如： "bit666keji123" 数字的个数为：6个
        String string="bit666keji123";
        char[]array=string.toCharArray();
        int count=0;
        for (int i = 0; i < array.length; i++) {
            if (array[i]>='0'&&array[i]<='9') {
                count++;
            }
        }
        System.out.println(count);
    }
    public static void main7(String[] args) {
        //例如： "aabbccdaa" -> "a2b2c2d1a2" 或者 例如： "abbcccffr" -> "a1b2c3f2r1
        String string ="abbcccffr";
        StringBuilder stringBuilder=new StringBuilder();
        char[]array=string.toCharArray();
        int count=1;
        int i=0;
        for ( i = 0; i < array.length-1; i++) {
            if (array[i]==array[i+1]) {
                count++;
            }else {
                stringBuilder.append(array[i]);
                stringBuilder.append(count);
                count=1;
            }
        }
        stringBuilder.append(array[i]);
        stringBuilder.append(count);
        System.out.println(stringBuilder);

    }
    public static void main5(String[] args) {
        //字符串逆置
        String string="hello";
        int left=0;
        int right=string.length()-1;
        char[]array=string.toCharArray();
        while (left<right) {
            char tmp=array[left];
            array[left]=array[right];
            array[right]=tmp;
            left++;
            right--;
        }
        String p=new String(array);
        System.out.println(p);
    }
    public static void main4(String args[]){
        int num = 10;
        System.out.println(test(num));
    }
    public static int test(int b){
        try {
            b += 10;

            return b;
        }catch(RuntimeException e){

        }catch(Exception e2){

        } finally{
            b += 10;
            return b;
        }
    }
    public static boolean func(int n) {
        //如何判断一个数是否是2的k次方？这里不需要确定k的值。例如：1是2的0次方，2是2的1次方，4是2的平方，
        //求N是不是2的K次方
            while (n!=1) {
                if (n%2!=0) {
                    return false;
                }
                n/=2;
            }
            return true;
    }
    public static void fnid_val(int [][]arr,int row,int col,int num) {
                //矩阵查找
        if (arr==null) {
            return;
        }
      int x=0;//行
      int y=col-1;//列
        while (x<row&&y>=0) {
            if (arr[x][y]>num) {
                y--;
            } else if(arr[x][y]<num) {
                x++;
            } else {
                System.out.println(x+" "+y);
                break;
            }
        }

    }

    public static void main3(String[] args) {
//        int[][]array={{1, 2, 3}, {4, 5, 6}, {7, 8, 9},{10,11,12}};
//        fnid_val(array,array.length,array[0].length,12);
        int [][]array = {
                {1,2,8,9},
                {2,4,9,12},
                {4,7,10,13},
                {6,8,11,15}
        };
        fnid_val(array,3,3,10);
    }

    public static void main2(String[] args) {
        //一个整型数组里除了两个数字之外，其他的数字都出现了两次。请写程序找出这两个只出现一次的数字
        //异或，分两部分
        int[]array={1,2,3,4,5,1,5,3};
        int p=0;
        for (int i = 0; i < array.length; i++) {
         p^=array[i];
        }
        int n=0;
        while ((p&1)!=1) {
            p>>=1;
            n++;
        }
        int a=0;
        int b=0;
        for (int i = 0; i <array.length ; i++) {
            if ((array[i]>>n&1)==1) {
                a^=array[i];
            } else {
                b^=array[i];
            }
        }
        System.out.println(a+" "+b);
        
    }
    public static void main1(String[] args) {
        System.out.println(func(256));
    }
}

